package com.zhangshitong.util;

import com.google.common.base.Splitter;

import java.util.List;
import java.util.stream.Collectors;
/**
 * 把"aclId1,aclId2,aclId3,...."转换成List<Integer>的形式
 * @author Administrator
 *
 */
public class StringUtil {

    public static List<Integer> splitToListInt(String str) {
    	//1,2, 3,4,  先以,分割，然后trim一下，然后将空的串移除掉
        List<String> strList = Splitter.on(",").trimResults().omitEmptyStrings().splitToList(str);
        return strList.stream().map(strItem -> Integer.parseInt(strItem)).collect(Collectors.toList());
    }
}
